from django.db import models

from userapp.models import *


class Address(models.Model):
    name=models.CharField(max_length=20,verbose_name='收件名')
    site=models.CharField(max_length=200,verbose_name='收件地址')
    postcode=models.IntegerField(verbose_name='邮编')
    phone=models.CharField(max_length=20,verbose_name='手机号')
    user=models.ForeignKey(User,on_delete=models.CASCADE,verbose_name='关联用户',related_name='addresses')
    flag = models.SmallIntegerField(verbose_name='是否是默认值', default=0)  # 0 表示不是默认值  1表示是默认值
    class Meta:
        db_table='address'
